import router from '.'
// import store from '../store'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
// import getPageTitle from '@/utils/get-page-title'

NProgress.configure({ showSpinner: false }) // NProgress Configuration

router.beforeEach(async(to, from, next) => {
  // NProgress.start()
  // document.title = getPageTitle(to.meta.title)
  // if (store.state.permission.routes.length <= 0) {
  //   const accessRoutes = await store.dispatch('permission/generateRoutes')
  //   router.addRoutes(accessRoutes)
  //   next({ ...to, replace: true })
  // } else {
  next()
  // }
})
router.afterEach(() => {
  NProgress.done()
})
